/*package com.midea.trade.sharding.jdbc;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import com.midea.trade.sharding.core.jdbc.PreparedStatementCallback;
import com.midea.trade.sharding.core.jdbc.StatementCallback;
import com.midea.trade.sharding.jdbc.builder.DruidStatementContextBuilder;
import com.midea.trade.sharding.jdbc.builder.StatementContextBuilder;

public class DruidConnectionWrapper extends ConnectionWrapper {
    public DruidConnectionWrapper(Connection connection) {
	    super(connection);
    }
	//此处就是druid解析的入口
	StatementContextBuilder druidBuilder = new DruidStatementContextBuilder();
	
	@Override
	public Statement createStatement() throws SQLException {
		StatementWrapper statement = new StatementWrapper(this, druidBuilder);
		StatementCallback callback = new StatementCallback() {
			@Override
			public Statement createStatement(Connection conn)throws SQLException {
				return conn.createStatement();
			}
		};
		statement.setCallback(callback);
		return statement;
	}

	
	@Override
	public PreparedStatement prepareStatement(String sql) throws SQLException {
		PreparedStatementWrapper statement = new PreparedStatementWrapper(this,
				druidBuilder, sql);
		//WritableExecuteHandler在创建statement的时候回调
		PreparedStatementCallback callback = new PreparedStatementCallback() {
			@Override
			public Statement createStatement(Connection conn)throws SQLException {
				return conn.createStatement();
			}
			@Override
			public PreparedStatement prepareStatement(Connection conn,
					String sql) throws SQLException {
				return conn.prepareStatement(sql);
			}
		};
		
		statement.setCallback(callback);
		return statement;
	}


	@Override
	public Statement createStatement(final int resultSetType,
			final int resultSetConcurrency) throws SQLException {
		StatementWrapper statement = new StatementWrapper(this, druidBuilder);
		StatementCallback callback = new StatementCallback() {
			@Override
			public Statement createStatement(Connection conn)
					throws SQLException {
				return conn.createStatement(resultSetType, resultSetConcurrency);
			}
		};
		statement.setCallback(callback);
		return statement;
	}

	@Override
	public PreparedStatement prepareStatement(String sql,
			final int resultSetType, final int resultSetConcurrency)
			throws SQLException {
		PreparedStatementWrapper statement = new PreparedStatementWrapper(this,
				druidBuilder, sql);
		PreparedStatementCallback callback = new PreparedStatementCallback() {

			@Override
			public Statement createStatement(Connection conn)
					throws SQLException {
				return conn.createStatement();
			}

			@Override
			public PreparedStatement prepareStatement(Connection conn,
					String sql) throws SQLException {
				return conn.prepareStatement(sql, resultSetType,
						resultSetConcurrency);
			}
		};
		statement.setCallback(callback);
		return statement;
	}


	@Override
	public Statement createStatement(final int resultSetType,
			final int resultSetConcurrency, final int resultSetHoldability)
			throws SQLException {
		StatementWrapper statement = new StatementWrapper(this, druidBuilder);
		StatementCallback callback = new StatementCallback() {

			@Override
			public Statement createStatement(Connection conn)
					throws SQLException {
				return conn.createStatement(resultSetType,
						resultSetConcurrency, resultSetHoldability);
			}
		};
		statement.setCallback(callback);
		return statement;
	}

	@Override
	public PreparedStatement prepareStatement(String sql,
			final int resultSetType, final int resultSetConcurrency,
			final int resultSetHoldability) throws SQLException {
		PreparedStatementWrapper statement = new PreparedStatementWrapper(this,
				druidBuilder, sql);
		PreparedStatementCallback callback = new PreparedStatementCallback() {

			@Override
			public Statement createStatement(Connection conn)
					throws SQLException {
				return conn.createStatement();
			}

			@Override
			public PreparedStatement prepareStatement(Connection conn,
					String sql) throws SQLException {
				return conn.prepareStatement(sql, resultSetType,
						resultSetConcurrency, resultSetHoldability);
			}
		};
		statement.setCallback(callback);
		return statement;
	}



	@Override
	public PreparedStatement prepareStatement(String sql,
			final int autoGeneratedKeys) throws SQLException {
		PreparedStatementWrapper statement = new PreparedStatementWrapper(this,
				druidBuilder, sql);
		PreparedStatementCallback callback = new PreparedStatementCallback() {

			@Override
			public Statement createStatement(Connection conn)
					throws SQLException {
				return conn.createStatement();
			}

			@Override
			public PreparedStatement prepareStatement(Connection conn,
					String sql) throws SQLException {
				return conn.prepareStatement(sql, autoGeneratedKeys);
			}
		};
		statement.setCallback(callback);
		return statement;
	}

	@Override
	public PreparedStatement prepareStatement(String sql,
			final int[] columnIndexes) throws SQLException {
		PreparedStatementWrapper statement = new PreparedStatementWrapper(this,
				druidBuilder, sql);
		PreparedStatementCallback callback = new PreparedStatementCallback() {

			@Override
			public Statement createStatement(Connection conn)
					throws SQLException {
				return conn.createStatement();
			}

			@Override
			public PreparedStatement prepareStatement(Connection conn,
					String sql) throws SQLException {
				return conn.prepareStatement(sql, columnIndexes);
			}
		};
		statement.setCallback(callback);
		return statement;
	}
	
	
	
	
	@Override
	public PreparedStatement prepareStatement(String sql,
			final String[] columnNames) throws SQLException {
		PreparedStatementWrapper statement = new PreparedStatementWrapper(this,
				druidBuilder, sql);
		PreparedStatementCallback callback = new PreparedStatementCallback() {
			@Override
			public Statement createStatement(Connection conn)
					throws SQLException {
				return conn.createStatement();
			}
			@Override
			public PreparedStatement prepareStatement(Connection conn,
					String sql) throws SQLException {
				return conn.prepareStatement(sql, columnNames);
			}
		};
		statement.setCallback(callback);
		return statement;
	}


}
*/